package com.itheima.property;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Properties;

public class Demo03 {


    public static void main(String[] args) throws IOException {
        Properties prop = new Properties();
        FileReader reader = new FileReader("day13\\student.properties", Charset.forName("utf-8"));
        prop.load(reader);
        System.out.println(prop);

        prop.setProperty("张艺兴",31+"");
        prop.setProperty("黄子韬",24+"");
        prop.setProperty("蔡徐坤",16+"");
        FileWriter writer = new FileWriter("day13\\student.properties");

        prop.store(writer,null);
        reader.close();
        writer.close();
    }
}
